package OOP;

public class SuperArray2 {
    int[] nums;
    int DQindex = -1;
    public SuperArray2(){
        this(3);
    }
    public SuperArray2(int rl){
        nums = new int[rl];
    }


    public void add(int date){
        DQindex++;
        if(DQindex>nums.length-1){
            int[] temp = new int[nums.length*2];
            for (int i = 0; i < nums.length; i++) {
                temp[i] = nums[i];
            }
            nums = temp;
        }else {
            nums[DQindex] = date;
        }
    }
    public void del(int index){
        if(index<0||index>nums.length-1){
            System.out.println("您删除的下标[");
        }
    }
}
